﻿using System.Web;
using ASPNETVN.PORTAL;

namespace WEATHER.Components
{
    public class CacheHelper
    {
        public static void DeleteOutputCache(string weatherType)
        {
            switch (weatherType)
            {
                case "AreaWeather":
                    HttpResponse.RemoveOutputCacheItem(Global.GetApplicationPath() + "/Modules/WEATHER.Modules.ONLINE/Pages/AreaWeather.aspx");
                    break;
                case "CurrentWeather":
                    HttpResponse.RemoveOutputCacheItem(Global.GetApplicationPath() + "/Modules/WEATHER.Modules.ONLINE/Pages/ProvinceWeather.aspx");
                    break;
                case "ProvinceWeather":
                    HttpResponse.RemoveOutputCacheItem(Global.GetApplicationPath() + "/Modules/WEATHER.Modules.ONLINE/Pages/ProvinceWeatherDetail.aspx");
                    break;
                case "ThoiTietDatLien24H":
                case "ThoiTietBien24H":
                case "DuBao10Ngay":
                case "DuBaoThang":
                case "DuBaoMua":
                    string url = Global.GetApplicationPath() + "/Modules/WEATHER.Modules.ONLINE/Pages/Meteor.aspx";
                    HttpResponse.RemoveOutputCacheItem(url);
                    break;

            }
        }
    }
}
